package com.jgb.android.api;

import java.util.ArrayList;

import com.jgb.android.adapter.FragmentTabAdapter;
import com.jgb.android.fragment.HomeFragment;
import com.jgb.android.fragment.SearchFragment;
import com.jgb.android.fragment.ShoppingFragment;
import com.jgb.android.fragment.UserFragment;
import com.jgb.api.R;

import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;

import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.RadioGroup;


public class MainActivity extends BaseActivity{
	private ArrayList<Fragment> fragments;
	private RadioGroup radioGroup;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_main);
        initpager();
        FragmentTabAdapter fragmentAdapter = new FragmentTabAdapter(getSupportFragmentManager(), fragments,R.id.tabcontent,  radioGroup);
    }
    private void initpager() {
		// TODO Auto-generated method stub
    	radioGroup = (RadioGroup) findViewById(R.id.main_tab);
    	fragments = new ArrayList<Fragment>();
    	fragments.add(HomeFragment.getInstance(null));
    	fragments.add(SearchFragment.getInstance(null));
    	fragments.add(ShoppingFragment.getInstance(null));
    	fragments.add(UserFragment.getInstance(null));
	}


}
